home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / ACL / Animation Class Library / Headers / AnimControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  4.0 KB  |  121 lines  |  [TEXT/MPCC]

  1.  
  2. /********************************************
  3.  **** Animation Class Library V1.0 © 1994 Yves Schmid & Alia Development
  4.  ****
  5.  **** AnimControl.h
  6.  ****
  7.  **** Created:      19 May 1994
  8.  **** Modified:     01 Septembre 1994
  9.  **** Version:      0
  10.  **** Compatible:   C++, Mac System 7
  11.  ****
  12.  **** Description:  Definitions for control commands.
  13.  ****            
  14.  ****
  15.  *******************/
  16.  
  17.  
  18. #ifndef AnimControl_H
  19. #define AnimControl_H
  20.  
  21.  
  22. #include "CoreHead.h"
  23.  
  24.  
  25. class AnimCObject;
  26.  
  27. //................................
  28. // Build a linked list with AnimControl structures (ended with "next"=NULL) and
  29. // pass it to an Anim object.
  30.  
  31.  
  32. struct AnimControl
  33. {
  34.     short            cmd;            // Command
  35.     float            x,y;            // Coordinates
  36.     float            cx,cy;            // For curves
  37.     float            speed;            // Speed in pixels
  38.     float            acceleration;    // Acceleration in pixels
  39.     long            sequence;        // A sequence number
  40.     long            wait;            // Wait value
  41.     unsigned long    data;            // Data
  42.     AnimControl        *next;            // A pointer on the next AnimControl or NULL.
  43.                                     // You can create a loop by pointing next to a
  44.                                     // previous command.
  45.  
  46.     unsigned long    userID;            // Use this entry like you want
  47.     
  48.     void            (*endproc)(AnimCObject*, AnimControl*); // NULL or a pointer on a function
  49.                                                         // which is called after the
  50.                                                         // command has been executed.
  51.                                                         // Your function receives
  52.                                                         // a pointer on the Anim object and
  53.                                                         // a pointer to the AnimControl
  54.                                                         // structure. You can modify
  55.                                                         // the "next" field in your
  56.                                                         // function before returning. It
  57.                                                         // allows you do interactive control.    
  58.  
  59.     Boolean            (*testproc)(AnimCObject*, AnimControl*); // NULL or a pointer on a function
  60.                                                         // which is called before executing
  61.                                                         // control. If your function returns
  62.                                                         // FALSE the control is not executed.
  63. };
  64.  
  65. //*****************************
  66. // Commands:
  67.  
  68.  
  69. // General
  70.  
  71. const short acmd_null    = 0;    // NULL command (synchronous)
  72.  
  73. const short acmd_place    = 10;    // Places the object to a new position. Specify
  74.                                 // the position with the x/y field of the
  75.                                 // control. Same as the "place" method. (synchronous).
  76.                                 // Sets oldx and oldy to the previous position.
  77.  
  78. const short acmd_move = 11;        // Places the object to a new position using deltas. Specify
  79.                                 // the deltas with the x/y field of the
  80.                                 // control. Same as the "move" method. (synchronous).
  81.                                 // Sets oldx and oldy to the previous position.
  82.  
  83. const short acmd_goto = 12;        // Starts to move the object. The object will go to
  84.                                 // the position specified in x/y using the speed and
  85.                                 // the acceleration. (asynchronous).
  86.                                 // Oldx and oldy contain always the previous position.
  87.  
  88. const short acmd_curve    = 13;    // Same as acmd_goto but does a curve which passes by
  89.                                 // cx/cy before going to x/y. (asynchronous).
  90.                                 // Oldx and oldy contain always the previous position.
  91.  
  92. const short acmd_wait    = 14;    // Waits. You must specify the number of ticks to wait
  93.                                 // in the "wait" variable of the AnimControl. (asynchronous).
  94.  
  95. const short acmd_delete    = 15;        // Deletes the animation object at next update (synchronous).
  96.  
  97. const short acmd_setsortflags = 16;    // Sets the current sorting flags of the AnimBase which
  98.                                     // controls this object. Use the "data" field to
  99.                                     // specify flags. (synchronous)
  100.  
  101. const short acmd_setpriority = 17;    // Changes the sorting priority. Use the "data" field to
  102.                                     // specify flags. (synchronous).
  103.  
  104. // Anim Class commands:
  105.  
  106.  
  107. const short acmd_setanimflags = 18;    // Sets the animation flags. Use the "data" field to
  108.                                     // specify flags.(synchronous).
  109.  
  110. const short acmd_setsequence = 19;    // Sets    a new sequence. Use the "sequence" field to 
  111.                                     // specify the sequence. (synchronous).
  112.  
  113. const short acmd_waitframe    = 20;    // Waits for a frame. You specify the frame number in the
  114.                                     // "wait" variable. (asynchronous).
  115.  
  116. const short acmd_waitnframes = 21;    // Waits a number of frames. You specify the frame number in the
  117.                                     // "wait" variable. (asynchronous).
  118.  
  119. #endif
  120.  
  121.